/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package entities;

import java.io.Serializable;

/**
 *
 * @author Andrés Felipe
 */
public class RequestXproduct implements Serializable {
    private static final long serialVersionUID = 1L;
    protected RequestXproductPK requestXproductPK;
    private int quantity;
    private Product product;
    private CustomerRequest customerRequest;

    public RequestXproduct() {
    }

    public RequestXproduct(RequestXproductPK requestXproductPK) {
        this.requestXproductPK = requestXproductPK;
    }

    public RequestXproduct(RequestXproductPK requestXproductPK, int quantity) {
        this.requestXproductPK = requestXproductPK;
        this.quantity = quantity;
    }

    public RequestXproduct(int idrequest, int productid) {
        this.requestXproductPK = new RequestXproductPK(idrequest, productid);
    }

    public RequestXproductPK getRequestXproductPK() {
        return requestXproductPK;
    }

    public void setRequestXproductPK(RequestXproductPK requestXproductPK) {
        this.requestXproductPK = requestXproductPK;
    }

    public int getQuantity() {
        return quantity;
    }

    public void setQuantity(int quantity) {
        this.quantity = quantity;
    }

    public Product getProduct() {
        return product;
    }

    public void setProduct(Product product) {
        this.product = product;
    }

    public CustomerRequest getCustomerRequest() {
        return customerRequest;
    }

    public void setCustomerRequest(CustomerRequest customerRequest) {
        this.customerRequest = customerRequest;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (requestXproductPK != null ? requestXproductPK.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof RequestXproduct)) {
            return false;
        }
        RequestXproduct other = (RequestXproduct) object;
        if ((this.requestXproductPK == null && other.requestXproductPK != null) || (this.requestXproductPK != null && !this.requestXproductPK.equals(other.requestXproductPK))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "entities.RequestXproduct[ requestXproductPK=" + requestXproductPK + " ]";
    }
    
}
